\documentclass[tikz,border=2mm]{standalone}
\usepackage{array,amsmath,mathptmx,xcolor,pifont}
\usepackage{bbding}
\usepackage[UTF8]{ctex}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\usepackage{tikz-cd}
\usepackage{tikz,graphicx,subfig,caption} % Required for drawing custom shapes
\usetikzlibrary{fit,matrix,chains,arrows,shapes,positioning,arrows.meta,chains,shadows,shapes.callouts,decorations.text,shapes.symbols,shapes.misc, positioning,decorations.pathreplacing,calc,backgrounds,}

% 额外添加
\usepackage{indentfirst}
\usepackage{diagbox}

\begin{document}
	\begin{tikzpicture}[>=latex,every node/.style={anchor=south west,,inner sep=0,fill=white}]
		
		\node(left)[draw,align=left,fill=cyan!20,inner sep=0.3em] at (0,0){  
			$Z' \to Z(0)$ \\
			$Z \to aAb(1)$ \\
			$A \to cd(2)$ \\
			$\ \to \varepsilon (3)$
		};
		\node(I0)[draw,align=left,fill=white,inner sep=0.3em] at ([xshift=4.5em, yshift=3.4em]left.south){
			{\textcolor{red}{$I_0$:}} $Z' \to \cdot Z$ \\
			\ \ \ \ $Z \to \cdot aAb$ 
		};
		\node(I1)[draw,align=left,fill=white,inner sep=0.3em] at ([xshift=13em, yshift=4.1em]left.south){
			{\textcolor{red}{$I_1$:}} $Z' \to Z \cdot $
		};
		\node(I2)[draw,align=left,fill=white,inner sep=0.3em] at ([xshift=9em, yshift=-2.2em]left.south){
			{\textcolor{red}{$I_2$:}} $Z' \to a \cdot Ab$ \\
			\ \ \ \ $A \to \cdot cd$ \\
			\ \ \ \ {\textcolor{red}{$A \to \cdot \varepsilon$}}
		};
		\node(I3)[draw,align=left,fill=white,inner sep=0.3em] at ([xshift=18em, yshift=-0.7em]left.south){
			{\textcolor{red}{$I_3$:}} $Z' \to aA \cdot b$
		};
		\node(I4)[draw,align=left,fill=white,inner sep=0.3em] at ([xshift=27.5em, yshift=-0.7em]left.south){
			{\textcolor{red}{$I_4$:}} $Z' \to aAb \cdot $
		};
		\node(I5)[draw,align=left,fill=white,inner sep=0.3em] at ([xshift=18em, yshift=-4em]left.south){
			{\textcolor{red}{$I_5$:}} $A' \to c \cdot d$
		};
		\node(I6)[draw,align=left,fill=white,inner sep=0.3em] at ([xshift=27.5em, yshift=-4em]left.south){
			{\textcolor{red}{$I_6$:}} $A' \to cd \cdot $
		};
		%连接线
		\draw[->] (I0.east) -- (I1.west);
		\draw[->] (I0.south) |- (I2.west);
		\draw[->] (I2.east) -- (I3.west);
		\draw[->] (I3.east) -- (I4.west);
		\draw[->] (I2.south) |- (I5.west);
		\draw[->] (I5.east) -- (I6.west);
		
		% 标注
		\node(+)[align=center,fill=white] at ([xshift=-1.1em, yshift=-0.3em]I0.west){+};
		\node(Z)[align=center,fill=white] at ([xshift=6.8em, yshift=0.3em]I0.west){Z};
		\node(OK)[align=center,fill=white] at ([xshift=0em, yshift=-1em]I1.east){OK\\ \_};
		\node(a)[align=center,fill=white] at ([xshift=-1em, yshift=0.5em]I2.west){a};
		\node(A)[align=center,fill=white] at ([xshift=-1em, yshift=0.5em]I3.west){A};
		\node(b)[align=center,fill=white] at ([xshift=-1em, yshift=0.5em]I4.west){b};
		\node(r1)[align=center,fill=white] at ([xshift=0em, yshift=-1em]I4.east){r(1)\\ \_};
		\node(r2)[align=center,fill=white] at ([xshift=0em, yshift=-1em]I6.east){r(2)\\ \_};
		\node(c)[align=center,fill=white] at ([xshift=-1em, yshift=0.5em]I5.west){c};
		\node(d)[align=center,fill=white] at ([xshift=-1em, yshift=0.5em]I6.west){d};
		\node(r3)[align=center,fill=white] at ([xshift=-5.5em, yshift=-5em]I2.west){{\textcolor{red}{r(3)}}\\{\textcolor{red}{$follow(A)=\{b\}$}}};
		
		\begin{pgfonlayer}{background}
			\node [draw, fill=white,fit=(I0)(I1)(I2)(I3)(I4)(I5)(I6)(r1)(r2)(r3)(+),inner sep=0.3em] {};
		\end{pgfonlayer}
		
		% Title
		\node(title)[draw,align=center,fill=white,inner sep=0.3em] at ([xshift=-2em, yshift=3em]left.west){扩展文法};
		\node(text)[align=left,fill=white] at ([xshift=-2em, yshift=-8em]left.west){$\ast$ 可以如此解决\\冲突的文法，称\\为{\textcolor{red}{SLR(1)文法}}。};
		
	\end{tikzpicture}
\end{document}